require 'socket'

Socket.tcp_server_loop(4481) do |conn|
  conn.write("wellcome")
  conn.close
end

# ➜  ~ echo whoaim | nc 127.0.0.1 4481
# wellcome%